import 'package:flutter/material.dart';

class CustomeRoute extends PageRouteBuilder{

  final Widget widget;
  CustomeRoute(this.widget)
    :super(
      transitionDuration: const Duration(seconds: 1),
      pageBuilder:(
        BuildContext context,
        Animation<double> animation1,
        Animation<double> animation2,){
          return widget;
        },
      
      transitionsBuilder:(
        BuildContext context,
        Animation<double> animation1,
        Animation<double> animation2,
        Widget child){
          return  FadeTransition(
            opacity: Tween(begin:0.0, end:1.0).animate(CurvedAnimation(
              parent: animation1,
              curve: Curves.fastOutSlowIn
            )),
            child: child,
          );
        }
    );
}